const app = getApp();
const AJAX = app.$ajax,
  $wx = app.$wx;

Page({
  data: {
    imgHost: app.imgHost,
    notice: 0
  },

  onLoad(){
  },

  onShow(){
    this.getUserInfo();
  },

  onShareAppMessage(){

  },

  getUserInfo(){
    AJAX.getUserInfo({
      loadType: 'bar',
      platform: 'wxapp'
    }).then(([status, res, msg]) => {
      if(status){
        this.setData({
          userInfo: res.user,
          address: res.address,
          notice: res.notice
        });
      }else{
        $wx.showToast(msg);
      }
    });
  }
});